<%--
  Created by IntelliJ IDEA.
  User: waqwb
  Date: 2021/12/25
  Time: 11:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>生成订单 - 当当网</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
    <link href="${ctx}/css/login.css" rel="stylesheet" type="text/css"/>
    <link href="${ctx}/css/page_bottom.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${ctx}/js/jquery-3.5.0.min.js"></script>

</head>

<body>
<div class="login_top">
    <a href="#" target="_blank"><img class="logo" src="${ctx}/images/logo.gif"/> </a>
</div>

<div class="login_step">
    生成订单骤:
    <span class="red_bold">1.确认订单</span> > 2.填写送货地址 > 3.订单成功
</div>
<div class="fill_message">

    <table class="tab_login">
        <tr>
            <td valign="top" class="w1" style="text-align: left">
                <b>序号</b>
            </td>
            <td valign="top" class="w1" style="text-align: left">
                <b>商品名称</b>
            </td>
            <td valign="top" class="w1" style="text-align: left">
                <b>商品单价</b>
            </td>
            <td valign="top" class="w1" style="text-align: left">
                <b>商品数量</b>
            </td>
            <td valign="top" class="w1" style="text-align: left">
                <b>小计</b>
            </td>
        </tr>

        <!-- 订单开始 -->
        <c:set var="totalMoney" value="0"></c:set>
        <c:forEach var="cartItem" items="${cart}" varStatus="status">
            <tr>
                <td valign="top">
                        ${status.index+1}
                </td>
                <td valign="top">
                        ${cartItem.value.bookName}
                </td>
                <td valign="top">
                    ￥${cartItem.value.dangPrice}
                </td>
                <td valign="top">
                        ${cartItem.value.amount}
                </td>
                <td valign="top">
                    ￥${cartItem.value.dangPrice*cartItem.value.amount}
                </td>
            </tr>
            <c:set var="totalMoney"
                   value="${totalMoney+
                   cartItem.value.dangPrice*cartItem.value.amount}"></c:set>
        </c:forEach>
        <!-- 订单结束 -->
        <tr>
            <td valign="top" class="w1" style="text-align: left" colspan="5">
                <b>总价￥
                    ${totalMoney}
                </b>
            </td>
        </tr>
    </table>

    <div class="login_in">
        <input id="cancel" class="button_1" type="button" value="取消" onclick="location='cart.jsp'"/>
        <input id="next" class="button_1" type="button" onclick="location='address_form.jsp'" value="下一步"/>
    </div>

</div>
<div>
    <hr style="height: 1px; width: 972px; color: #cfcfcf"/>
    <div class="b_left"></div>
    <div class="publish_bottom_message2">
        <div class="copyright">
            Copyright (C) 当当网 2004-2008, All Rights Reserved
        </div>
        <div class="validate">
            <a href="#http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001051000098" target="_blank"> <img
                    src="${ctx}/images/validate.gif" border="0"/>
            </a>
            <p>
                <a href="" target="_blank">京ICP证041189号</a>
            </p>
        </div>
    </div>
</div>
</body>

</html>
